package routers

import (
	"beego_benchu/controllers"
	"beego_benchu/middlewares"

	"github.com/beego/beego/v2/server/web"
)

func init() {
	web.Router("/", &controllers.DefaultController{}, "get:GetDefault")
	web.Router("/student", &controllers.StudentController{}, "get:GetStudent")

	web.Router("/user/GetUserInfo", &controllers.UserController{}, "get:GetUserInfo")
	web.Router("/user/GetTpl", &controllers.UserController{}, "get:GetTpl")

	web.Router("/redis/GetRedisKey", &controllers.RedisDemoController{}, "get:GetRedisKey")

	web.Router("/mq/GetMq", &controllers.MqDemoController{}, "get:GetMq")
	web.Router("/mq/GetMqEx", &controllers.MqDemoController{}, "get:GetMqEx")
	web.Router("/mq/GetDirect", &controllers.MqDemoController{}, "get:GetDirect")
	web.Router("/mq/GetTopic", &controllers.MqDemoController{}, "get:GetTopic")
	web.Router("/mq/GetDlx", &controllers.MqDemoController{}, "get:GetDlx")
	web.Router("/mq/GetTwoDlx", &controllers.MqDemoController{}, "get:GetTwoDlx")

	//过滤器 (根据路由规则)
	web.InsertFilter("/user/*", web.BeforeRouter, middlewares.Filter_user)
}
